import { ProxyOb } from "./ProxyOb";

export module GlobalDataModuler {
    export class GlobalData {
        static defaultName: string = 'GlobalData默认的全局名字';
        static info: string = 'xin';
        static gold: number = 0;
        static diamond: number = 9000;
        static progress: number = 0;
        static icon: number = 0;
        static check = {
            selectA: true,
            selectB: false,
            selectC: false,
        }
        static obj = {
            progress: 111
        }
        static array = [
            { name: 's1', age: 18, sex: 0 },
            { name: 's2', age: 16, sex: 1 },
            { name: 's3', age: 12, sex: 2 },
        ]
        //菜单状态（代表选择了哪个菜单
        static menu = {
            state: 0
        }
    }

    export class PlayData {
        static defaultName: string = 'PlayData默认的名字';
        static level: number = 0;
        static exp: number = 15255;//exp
        static exp_max: number = 100000;//升级目标exp
        static gold: number = 10000;

        static hp: number = 450;
        static mhp: number = 1500;
        static mp: number = 700;
        static mmp: number = 15000;

        static atk: number = 5;
        static mat: number = 10;
        static def: number = 10;
        static mdf: number = 10;
        static spd: number = 100;
        static luk: number = 5;
        static cri: number = 0; //暴击率

        static skill_point: number = 15;//技能点
        static prop_point: number = 10; //属性点

        static equips = [3, 3, 12, 0, 0, 1, -1] //对应8个装备孔的id编号（会自动索引到需要的数据库）
    }
    /**
     * 局部UI显示内容
     */
    export class HomeUiInfo {
        static bag = {
            sort: 0,
            sort2: 2,
            type: 'all',
        }
        static skill = {
            id: 0,
            pic: 0,
            name: '??',
            level: 0,
            info: '未知'
        }
    }
}
let GlobalProxy = new ProxyOb(GlobalDataModuler.GlobalData, `game`,);
let PlayerProxy = new ProxyOb(GlobalDataModuler.PlayData, `player`,);
let uiProxy = new ProxyOb(GlobalDataModuler.HomeUiInfo, `ui`,);

